/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/11/06
* File: EnnPlatform.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef EnnPlatform_h__
#define EnnPlatform_h__

/** Many of them come from ogre. */

/** The platform Enn must support */
#define ENN_PLATFORM_WINDOWS		1
#define ENN_PLATFORM_LINUX			2
#define ENN_PLATFORM_APPLE			3
#define ENN_PLATFORM_APPLE_IOS		4
#define ENN_PLATFORM_ANDROID		5

#define ENN_COMPILER_MSVC			1
#define ENN_COMPILER_GNUC			2
#define ENN_COMPILER_BORL			3
#define ENN_COMPILER_WINSCW			4
#define ENN_COMPILER_GCCE			5
#define ENN_COMPILER_CLANG			6

#define ENN_ARCHITECTURE_32			1
#define ENN_ARCHITECTURE_64			2

#define ENN_ENDIAN_LITTLE			1
#define ENN_ENDIAN_BIG				2

/** OS Platform */
#if defined( __WIN32__ ) || defined( _WIN32 )
#   define ENN_PLATFORM ENN_PLATFORM_WINDOWS
#elif defined( __APPLE_CC__)
#endif

/** Architecture, 32 or 64 */
#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
#   define ENN_ARCH_TYPE ENN_ARCHITECTURE_64
#else
#   define ENN_ARCH_TYPE ENN_ARCHITECTURE_32
#endif

#ifdef ENN_CONFIG_BIG_ENDIAN
#define ENN_ENDIAN	ENN_ENDIAN_BIG
#else
#define ENN_ENDIAN	ENN_ENDIAN_LITTLE
#endif

/** Windows settings */
#if ENN_PLATFORM == ENN_PLATFORM_WINDOWS

/** If we're not including this from a client build, specify that the stuff
	should get exported. Otherwise, import it.
 */
#	if defined( ENN_STATIC_LIB )
#   	define _EnnExport
#   	define _EnnPrivate
#   else
#   	if defined( ENN_NONCLIENT_BUILD )
#       	define _EnnExport __declspec( dllexport )
#   	else
#           if defined( __MINGW32__ )
#               define _EnnExport
#           else
#       	    define _EnnExport __declspec( dllimport )
#           endif
#   	endif
#   	define _EnnPrivate
#	endif
/** Win32 compilers use _DEBUG for specifying debug builds.
	for MinGW, we set DEBUG
 */
#   if defined(_DEBUG) || defined(DEBUG)
#       define ENN_DEBUG_MODE 1
#   else
#       define ENN_DEBUG_MODE 0
#   endif

#endif	/* ENN_PLATFORM == ENN_PLATFORM_WINDOWS */

#if defined(_MSC_VER)
#   define ENN_COMPILER ENN_COMPILER_MSVC
#   define ENN_COMP_VER _MSC_VER
#elif defined( __GNUC__ )
#   define ENN_COMPILER ENN_COMPILER_GNUC
#   define ENN_COMP_VER (((__GNUC__)*100) + \
	(__GNUC_MINOR__*10) + \
	__GNUC_PATCHLEVEL__)
#endif

#   define ENN_SIMD_ALIGNMENT  16



/** Integer formats of fixed bit width */
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;
typedef int int32;
typedef short int16;
typedef char int8;

#if ENN_PLATFORM == ENN_PLATFORM_WINDOWS
typedef unsigned __int64 uint64;
typedef __int64 int64;
#else
typedef unsigned long long uint64;
typedef long long int64;
#endif

#endif    /* EnnPlatform_h__ */